package Demo01;

abstract class animal{
    public String name;
    public int age;

    public animal(){

    }

    public animal(String name,int age){
        this.name=name;
        this.age=age;
    }

    //抽象方法
    public abstract void eat();

}

class dog extends animal{
    public dog(String name,int age){
        super(name,age);
    }

    @Override
    public void eat(){
        System.out.println(name+"吃狗粮！！！");
    }

}

public class test {
    public static void drawmap(animal a){
        a.eat();
    }

    public static void main(String[] args) {
        animal a1=new dog("二哈",10);
        a1.eat();
        System.out.println("------------------");
        dog d2=new dog("拉布拉多",15);
        drawmap(d2);
    }

}
